package cn.rxmind.dlicense.server.dto;

import cn.hutool.core.bean.BeanUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import cn.rxmind.dlicense.core.rule.ActiveTimeRule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 激活时间规则参数
 *
 * @author renxin
 * @email renxinzhiliangzhi@163.com
 * @date 2021/4/20 9:01 上午
 */
@Data
@ApiModel(value = "生效时间规则参数",description = "生效时间规则参数")
public class ActiveTimeRuleDTO {

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8" )
    @ApiModelProperty("生效起始时间：格式yyyy-MM-dd HH:mm:ss")
    private Date notBefore;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8" )
    @ApiModelProperty("生效截止时间：格式yyyy-MM-dd HH:mm:ss")
    private Date notAfter;

    public ActiveTimeRule covert2ActiveTimeRule(){

        return BeanUtil.toBean(this,ActiveTimeRule.class);
    }
}
